In Cypress, Hooks are special functions borrowed from the Mocha testing framework that allow you to run a set of commands before or after your tests.
before(): Executes once before all tests in a block. Used in Global setup (e.g. login, load data)
after(): Executes once after all tests in a block. Used in Global cleanup (e.g. logout, clear data)
beforeEach(): Executes before each test in a block. Used in Reset state, visit URL before each test
afterEach(): Executes after each test in a block. Used in Clean up per test (e.g. delete test data)